#include <stdio.h>
int main(int argc, char const *argv[])
{
	int a,b,c,ans;
	int caseNo=0;
	while(scanf("%d%d%d",&a,&b,&c)==3)
	{
		caseNo++;
		ans=-1;
		for (int s = 10; s <=100; ++s)
		{
			if(s%3==a &&s%5==b && s%7==c)
			{
				ans=s;
				break;
			}
		}
		if(ans!=-1)
		{
			printf("Case %d:%d\n",caseNo,ans);
		}
		else
		{
			printf("Case %d:No answer\n",caseNo);
		}
	}
	return 0;
}